package model

// 历史数据 仅查询daily使用

type History struct {
	OID   string          `bson:"_id" json:"_id" `
	IID   int32           `bson:"iid" json:"iid"`
	Value map[int32]int64 `bson:"value" json:"value"` //通用打点
}

/*
func (this *History) Schema() *schema.Schema {
	sch, _ := schema.Parse(this)
	return sch
}
func (this *History) IType(int32) int32 {
	return config.ITypeHistory
}

func (this *History) Upsert(u *updater.Updater, op *operator.Operator) bool {
	return false
}

func (this *History) Getter(u *updater.Updater, coll *dataset.Collection, keys []string) error {
	uid := u.Uid()
	if uid == "" {
		return errors.New("daily.Getter uid not found")
	}
	var rows []*History
	tx := db.Model(&Daily{}).Where("uid = ?", uid)
	tx = tx.Order("iid", -1)
	tx = tx.Limit(100)
	if tx = tx.Model(&Daily{}).Find(&rows); tx.Error != nil {
		return tx.Error
	}
	for _, v := range rows {
		if v.Value == nil {
			v.Value = make(map[int32]int64)
		}
		coll.Receive(v.OID, v)
	}

	return nil
}
func (this *History) Setter(_ *updater.Updater, bw dataset.BulkWrite) error {
	return errors.New("history setter disabled")
}

func (this *History) BulkWrite(_ *updater.Updater) dataset.BulkWrite {
	return nil
}
func (this *History) TableOrder() int32 {
	return RoleTableOrder - 1
}
*/
